package Test03;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;

public class LoginClient {
	public static void main(String[] args) {
		try {
		Socket  socket=new Socket("localhost",8800);
		OutputStream os=socket.getOutputStream();
		String info="用户名：Tom,密码：123456";
		os.write(info.getBytes());
		socket.shutdownOutput();
		InputStream is=socket.getInputStream();
		BufferedReader br=new BufferedReader(new InputStreamReader(is));
		String line=br.readLine();
		while (line!=null) {
			System.out.println(line);
			line=br.readLine();
		}
		is.close();
		socket.close();
		os.close();
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}

}
